import sys
import os
sys.path.append(os.path.abspath(os.path.dirname(__file__)) + "/..")
from stock.stock_utils import *

day = 60*4

class StockBase(object):
    """stock base"""
    def __init__(self, code, cycle = day, num = 100):
        super().__init__()
        self.code = code
        self.data = None
        self.cycle = cycle
        self.num = num

    def Init(self):
        pass
    
    def GetData(self):
        self.data = get_url_data(get_url(self.code, self.cycle, self.num))
        if self.data == None:
            return False

        return True
